﻿using System;
using Framework.Common.AOP.Performance;
namespace Framework.Sample
{
    public class TestAOPTime : ITest
    {

        public void Test()
        {
            Framework.Common.PerformanceHelper.OutputAction = Console.Write;
            Test1();
            Test2();
            Framework.Common.PerformanceHelper.Time(() => Test1(), 100, "test1 - 100");
            Framework.Common.PerformanceHelper.Time(() => Test2(), 100, "test2 - 100");

            Framework.Common.PerformanceHelper.Time(() => Test1(), 10000, "test1-10000");
            Framework.Common.PerformanceHelper.Time(() => Test2(), 10000, "test2-10000");

            Framework.Common.PerformanceHelper.Time(() => Test1(), 100000, "test1-100000");
            Framework.Common.PerformanceHelper.Time(() => Test2(), 100000, "test2-100000");

            Console.Read();
        }

        [Time]
        public DateTime Test1()
        {
            return DateTime.Now;
        }

        [Time]
        public DateTime Test2()
        {
            return DateTime.Now;
        }
    }
}